import React, { PureComponent, Fragment } from 'react';
import { connect } from 'dva';
import NonstandardValueReviewC from '../../../repertoryManagement/nonstandardValueReview/nonstandardValueReviewC';
import config from '../../../../utils/tableMoreIdConfig';
import CardC from '../../Barra/comps/cardC';
import { findValueByCode } from '../../../../utils/utils';
@connect(({ loading, nonstandardValueReviewM, globalM }) => ({
  loading,
  nonstandardValueReviewM,
  globalM,
}))
export default class BatchConfirm extends PureComponent {
  state = {};
  componentDidMount() {
    const {
      globalM: {
        dataDictionary: { BAXX_JNTGJGMC = [] },
      },
    } = this.props;
    //获取托管人名称
    this.props.dispatch({
      type: 'nonstandardValueReviewM/queryCustodianList',
      payload: {},
      callback: (data) => {
        if (data) {
          data.map((item) => {
            item.title = findValueByCode(item.value, BAXX_JNTGJGMC);
          });
        }
        this.setState({
          custodianList: data || [],
        });
      },
    });
  }

  UNSAFE_componentWillReceiveProps(nextProps) {}
  onClose = () => {
    this.props.changePage(1, 'refreshPrice');
  };

  render() {
    return (
      <div>
        <CardC title='批量复核' type='back' showContent={true} titleIsShow={false} changeFormPage={() => this.onClose()} />
        <div style={{ background: '#fff', padding: '20px', height: 'calc(100vh - 140px' }}>
          <NonstandardValueReviewC setId={config.nonValue['costTable']} type={'3'} allUnConfirm={true} custodianList={this.state.custodianList || []} />
        </div>
      </div>
    );
  }
}
